<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<form action="/product/create" method="post" id="create">
    <input type="button" value="${token}" id="token"/>
</form>
<button type="button" onclick="submits()">提交</button>


</body>
<script>
    function getToken() {
        $.ajax( {
            url:"/product/savetoken",
            success:function (a) {
                $("#token").val(a);
            },
            async:false
        });
    }
    function submits() {
        getToken();
        $("#create").submit();

}

</script>
</html>
